Skip to main content

User-level Threading Library

Scenario

We aim to implement a user-level threading library that provides a POSIX Threads (pthreads) API. The library should be portable across different operating systems and architectures and should be usable in programs written in various programming languages.

Answer the following questions with "True" or "False" and justify the answer. Justification should be simple, 2-3 sentences for each answer.

Questions

  1. The library can only be used in programs written in compiled languages, NOT interpreted ones. Answer: False

  2. The library can work on operating systems with and without kernel-level thread support. Answer: True

  3. The library does not need to expose synchronization primitives (working with mutexes, spinlocks, condition variables). Answer: False

  4. Programs using the library must be dynamically linked. Answer: False

  5. Code within the library does produce page faults. Answer: False

  6. Code within the library does not lead to system calls. Answer: False

  7. For creating a thread on Linux, the library uses the clone() system call. Answer: False

  8. Programs using the library can run in a Docker container. Answer: True

  9. Modifying a file cursor in one thread will be visible in another thread. Answer: True

  10. A program using the library will use only one core/processor. Answer: True

  11. Programs using the library cannot use shared memory to communicate with other processes. Answer: False